package cn.xunjie.ymcc.feign;

import cn.xunjie.ymcc.result.JSONResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class MediaSearchFeignClientFallBackFactory implements FallbackFactory<MediaSearchFeignClient> {
    @Override
    public MediaSearchFeignClient create(Throwable throwable) {
        return new MediaSearchFeignClient() {
            @Override
            public JSONResult searchMediaFiles(Long chapterId) {
                throwable.printStackTrace();
                return JSONResult.error("服务不可达！！");
            }
        };
    }
}
